function Err=logitlev1fixedlambda(lambda,row,freq)

n=length(row);

l=lambda;
pred=zeros(n,3);
for g=1:n
    sumpay=sum(row{g},2);
    pred(g,:)=exp(l*sumpay);
    pred(g,:)=pred(g,:)./sum(pred(g,:));
end
err=zeros(n,1);
for i=1:n
    err(i)=freq(i,1)*log((freq(i,1)+eps)/pred(i,1))+freq(i,2)*log((freq(i,2)+eps)/pred(i,2))+freq(i,3)*log((freq(i,3)+eps)/pred(i,3));
end
Err=mean(err);
